//
//  ZTleftController.m
//  项目练习
//
//  Created by 张江涛 on 15/12/3.
//  Copyright © 2015年 张江涛. All rights reserved.
//

#import "ZTleftController.h"

@interface ZTleftController ()

@end

@implementation ZTleftController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"推荐标签";
    self.view.backgroundColor = [UIColor grayColor];
    
    //左上角的返回按钮
    UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [backButton setTitle:@"返回" forState:UIControlStateNormal];
    [backButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [backButton setTitleColor:[UIColor redColor] forState:UIControlStateHighlighted];
    [backButton setImage:[UIImage imageNamed:@"navigationButtonReturn"] forState:UIControlStateNormal];
    [backButton setImage:[UIImage imageNamed:@"navigationButtonReturnClick"] forState:UIControlStateHighlighted];
    [backButton sizeToFit];
    
    [backButton addTarget:self action:@selector(backButtonClick) forControlEvents:UIControlEventTouchUpInside];
    backButton.contentEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:backButton];
}


//监听backButton按钮的点击
- (void)backButtonClick
{
    [self.navigationController popToRootViewControllerAnimated:YES];
}



@end
